package com.ruoyi.rural.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rural.mapper.RuralVirusPreventionMaterialsDonateMapper;
import com.ruoyi.rural.domain.RuralVirusPreventionMaterialsDonate;
import com.ruoyi.rural.service.IRuralVirusPreventionMaterialsDonateService;

/**
 * 防疫物资捐赠管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-17
 */
@Service
public class RuralVirusPreventionMaterialsDonateServiceImpl implements IRuralVirusPreventionMaterialsDonateService 
{
    @Autowired
    private RuralVirusPreventionMaterialsDonateMapper ruralVirusPreventionMaterialsDonateMapper;

    /**
     * 查询防疫物资捐赠管理
     * 
     * @param id 防疫物资捐赠管理主键
     * @return 防疫物资捐赠管理
     */
    @Override
    public RuralVirusPreventionMaterialsDonate selectRuralVirusPreventionMaterialsDonateById(String id)
    {
        return ruralVirusPreventionMaterialsDonateMapper.selectRuralVirusPreventionMaterialsDonateById(id);
    }

    /**
     * 查询防疫物资捐赠管理列表
     * 
     * @param ruralVirusPreventionMaterialsDonate 防疫物资捐赠管理
     * @return 防疫物资捐赠管理
     */
    @Override
    public List<RuralVirusPreventionMaterialsDonate> selectRuralVirusPreventionMaterialsDonateList(RuralVirusPreventionMaterialsDonate ruralVirusPreventionMaterialsDonate)
    {
        return ruralVirusPreventionMaterialsDonateMapper.selectRuralVirusPreventionMaterialsDonateList(ruralVirusPreventionMaterialsDonate);
    }

    /**
     * 新增防疫物资捐赠管理
     * 
     * @param ruralVirusPreventionMaterialsDonate 防疫物资捐赠管理
     * @return 结果
     */
    @Override
    public int insertRuralVirusPreventionMaterialsDonate(RuralVirusPreventionMaterialsDonate ruralVirusPreventionMaterialsDonate)
    {
        ruralVirusPreventionMaterialsDonate.setId(UUID.randomUUID().toString());
        ruralVirusPreventionMaterialsDonate.setCreateTime(DateUtils.getNowDate());
        return ruralVirusPreventionMaterialsDonateMapper.insertRuralVirusPreventionMaterialsDonate(ruralVirusPreventionMaterialsDonate);
    }

    /**
     * 修改防疫物资捐赠管理
     * 
     * @param ruralVirusPreventionMaterialsDonate 防疫物资捐赠管理
     * @return 结果
     */
    @Override
    public int updateRuralVirusPreventionMaterialsDonate(RuralVirusPreventionMaterialsDonate ruralVirusPreventionMaterialsDonate)
    {
        ruralVirusPreventionMaterialsDonate.setUpdateTime(DateUtils.getNowDate());
        return ruralVirusPreventionMaterialsDonateMapper.updateRuralVirusPreventionMaterialsDonate(ruralVirusPreventionMaterialsDonate);
    }

    /**
     * 批量删除防疫物资捐赠管理
     * 
     * @param ids 需要删除的防疫物资捐赠管理主键
     * @return 结果
     */
    @Override
    public int deleteRuralVirusPreventionMaterialsDonateByIds(String[] ids)
    {
        return ruralVirusPreventionMaterialsDonateMapper.deleteRuralVirusPreventionMaterialsDonateByIds(ids);
    }

    /**
     * 删除防疫物资捐赠管理信息
     * 
     * @param id 防疫物资捐赠管理主键
     * @return 结果
     */
    @Override
    public int deleteRuralVirusPreventionMaterialsDonateById(String id)
    {
        return ruralVirusPreventionMaterialsDonateMapper.deleteRuralVirusPreventionMaterialsDonateById(id);
    }

    @Override
    public List<RuralVirusPreventionMaterialsDonate> selectRuralVirusPreventionMaterialsDonateListByWeek(RuralVirusPreventionMaterialsDonate ruralVirusPreventionMaterialsDonate) {
        return ruralVirusPreventionMaterialsDonateMapper.selectRuralVirusPreventionMaterialsDonateListByWeek(ruralVirusPreventionMaterialsDonate);
    }
}
